********************************************************************************
** 	TITLE:		us2012_anes_integrity				                          ** 	
**	AUTHOR:	    Review version                                                **
**	DATA:       anes_timeseries_2012                                          **
**	DATE:		December 2022	  				                   	          **	
**	VERSION:	Stata 16					                                  **	
********************************************************************************

* Version control

version 16.0

* Run poll file

do us2012_polls

* Open log file

capture log close       			  			              
log using "us2012_anes_integrity", replace

* Import knowledge question answers from Excel sheet

import excel anes_timeseries_2012_openends.xlsx, first sheet(Post2012) clear

keep caseid ofcrec_speaker ofcrec_vp ofcrec_pmuk ofcrec_cj

gen ofcrec_speaker_imported = .

replace ofcrec_speaker_imported = 1 if strpos(ofcrec_speaker, "speaker") > 0
replace ofcrec_speaker_imported = 1 if strpos(ofcrec_speaker, "Speaker") > 0
replace ofcrec_speaker_imported = 1 if strpos(ofcrec_speaker, "SPEAKER") > 0

replace ofcrec_speaker_imported = 0 if ofcrec_speaker_imported!=1

gen ofcrec_vp_imported = .

replace ofcrec_vp_imported = 1 if strpos(ofcrec_vp, "vice") > 0
replace ofcrec_vp_imported = 1 if strpos(ofcrec_vp, "Vice") > 0
replace ofcrec_vp_imported = 1 if strpos(ofcrec_vp, "VICE") > 0

replace ofcrec_vp_imported = 0 if ofcrec_vp_imported!=1

gen ofcrec_pmuk_imported = .

replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "england") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "England") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "ENGLAND") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "britain") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "Britain") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "BRITAIN") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "kingdom") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "Kingdom") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "KINGDOM") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "english") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "English") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "ENGLISH") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "british") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "British") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "BRITISH") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "uk") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "Uk") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "UK") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "gb") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "Gb") > 0
replace ofcrec_pmuk_imported = 1 if strpos(ofcrec_pmuk, "GB") > 0

replace ofcrec_pmuk_imported = 0 if ofcrec_pmuk_imported!=1

gen ofcrec_cj_imported = .

replace ofcrec_cj_imported = 1 if strpos(ofcrec_cj, "justice") > 0
replace ofcrec_cj_imported = 1 if strpos(ofcrec_cj, "Justice") > 0
replace ofcrec_cj_imported = 1 if strpos(ofcrec_cj, "JUSTICE") > 0
replace ofcrec_cj_imported = 1 if strpos(ofcrec_cj, "supreme") > 0
replace ofcrec_cj_imported = 1 if strpos(ofcrec_cj, "Supreme") > 0
replace ofcrec_cj_imported = 1 if strpos(ofcrec_cj, "SUPREME") > 0

replace ofcrec_cj_imported = 0 if ofcrec_cj_imported!=1

keep caseid ofcrec_speaker_imported ofcrec_vp_imported ofcrec_pmuk_imported ofcrec_cj_imported

save "knowledge_imported.dta", replace

* Open the dataset

use "anes_timeseries_2012.dta", clear

* Merge knowledge question answers from Excel sheet

merge m:1 caseid using knowledge_imported

drop _merge

* Election ID

gen election = "us2012-anes"


*********************************
** SATISFACTION WITH DEMOCRACY **
*********************************

* Satisfaction with democracy (post)

gen swd_post = cses_satisdem

recode swd_post -9=. -8=. -7=. -6=.

replace swd_post = 5 - swd_post

label define swd 1 "Not at all satisfied" 2 "Not very satisfied" 3 "Fairly satisfied" 4 "Satisfied"
label values swd_post swd


************************
** ELECTORAL FAIRNESS **
************************

* Fair vote count

gen integrity_4pts = electintpo_countfair

recode integrity_4pts -9=. -8=. -7=. -6=.

replace integrity_4pts = 5 - integrity_4pts


***************************
** INDEPENDENT VARIABLES **
***************************

* Time

gen sdate1 = admin_pre_ftf_iwdatefin

gen surveydate1 = date(sdate1,"YMD")

format %tdMon_DD,_CCYY surveydate1

gen sdate2 = admin_pre_web1_iwdatefin

gen surveydate2 = date(sdate2,"YMD")

format %tdMon_DD,_CCYY surveydate2

gen edate = 20121106

gen electiondate=date(string(edate,"%8.0f"),"YMD")

format %tdMon_DD,_CCYY electiondate

gen time1 = electiondate - surveydate1
gen time2 = electiondate - surveydate2

gen time = max(time1,time2)

* Post-election date

gen pdate1 = admin_post_ftf_iwdatebeg

gen podate1 = date(pdate1,"YMD")

format %tdMon_DD,_CCYY podate1

gen pdate2 = admin_post_web1_iwdatebeg

gen podate2 = date(pdate2,"YMD")

format %tdMon_DD,_CCYY podate2

gen podate = max(podate1,podate2)

format %tdMon_DD,_CCYY podate

drop if podate == 19004

* Gender

gen male = gender_respondent_x

recode male 2=0

* Age

gen age = dem_age_r_x

recode age -2=. 17=.

* Education

gen education = dem_edugroup_x

recode education -2=. -9=.

* Postsecondary

gen postsecondary = 0 if education < 3
replace postsecondary = 1 if education >= 3

* Region

gen state = sample_stfips

gen region = .

replace region = 1 if state == 09
replace region = 1 if state == 23
replace region = 1 if state == 25
replace region = 1 if state == 33
replace region = 1 if state == 44
replace region = 1 if state == 50
replace region = 1 if state == 34
replace region = 1 if state == 36
replace region = 1 if state == 42
replace region = 2 if state == 17
replace region = 2 if state == 18
replace region = 2 if state == 26
replace region = 2 if state == 39
replace region = 2 if state == 55
replace region = 2 if state == 19
replace region = 2 if state == 20
replace region = 2 if state == 27
replace region = 2 if state == 29
replace region = 2 if state == 31
replace region = 2 if state == 38
replace region = 2 if state == 46
replace region = 3 if state == 10
replace region = 3 if state == 11
replace region = 3 if state == 12
replace region = 3 if state == 13
replace region = 3 if state == 24
replace region = 3 if state == 37
replace region = 3 if state == 45
replace region = 3 if state == 51
replace region = 3 if state == 54
replace region = 3 if state == 01
replace region = 3 if state == 21
replace region = 3 if state == 28
replace region = 3 if state == 47
replace region = 3 if state == 05
replace region = 3 if state == 22
replace region = 3 if state == 40
replace region = 3 if state == 48
replace region = 4 if state == 04
replace region = 4 if state == 08
replace region = 4 if state == 16
replace region = 4 if state == 30
replace region = 4 if state == 32
replace region = 4 if state == 35
replace region = 4 if state == 49
replace region = 4 if state == 56
replace region = 4 if state == 02
replace region = 4 if state == 06
replace region = 4 if state == 15
replace region = 4 if state == 41
replace region = 4 if state == 53

label define region 1 "Northeast" 2 "Midwest" 3 "South" 4 "West"
label values region region

* Race

gen white = dem_raceeth_x

recode white -9=.

replace white = 0 if white!=1 & white!=.

* Income

gen income = incgroup_prepost_x

recode income -9=. -8=.

* Above average income

egen income_mean = mean(income)
egen income_sd = sd(income)
gen income_std = (income - income_mean)/income_sd

gen income_above = 0 if income_std < 0
replace income_above = 1 if income_std > 0

* Caring about outcome

gen care_whole = preswin_care

recode care_whole -9=. -8=. 2=0

* Closeness of election

gen closeness_whole = preswin_close

recode closeness_whole -9=. -8=. -1=. 1=0 2=1

* Party identification scale

gen pidscale_whole = pid_x

recode pidscale_whole -2=.

replace pidscale_whole = 8 - pidscale_whole

label define pidscale 1 "Strong loser PID" 2 "Weak loser PID" 3 "Leaner loser PID" 4 "No PID" 5 "Leaner winner PID" 6 "Weak winner PID" 7 "Strong winner PID"
label values pidscale_whole pidscale

* Party identification

gen pid = pidscale_whole

recode pid 4=0 1=2 3=2 5=1 6=1 7=1

label define pid 0 "Independent/Other" 1 "Democrat" 2 "Republican"
label values pid pid

* Party identification status

gen pidstatus_whole = pid

recode pidstatus_whole 0=2 1=3 2=1

label define pidstatus 1 "Loser PID" 2 "Independent/Other" 3 "Winner PID"
label values pidstatus_whole pidstatus

* Party identification strength

gen pidstrength =.

replace pidstrength = -99 if pidscale_whole == 4
replace pidstrength = 0 if pidscale_whole == 2 | pidscale_whole == 3 | pidscale_whole == 5 | pidscale_whole == 6
replace pidstrength = 1 if pidscale_whole == 1 | pidscale_whole == 7

label define strength -99 "No PID" 0 "Weak/Leaner" 1 "Strong"
label values pidstrength strength

* Actual vote

gen prevoteact = prevote_presvtwho

recode prevoteact -9=. -1=.

gen voteact = postvote_presvtwho

recode voteact -9=. -7=. -6=. -1=.

replace voteact = 0 if postvote_presvt == 2 | postvote_rvote > 0 & postvote_rvote < 4

replace voteact = prevoteact if prevoteact!=.

label define voteact 0 "Not voted" 1 "Barack Obama" 2 "John McCain" 5 "Other"
label values voteact voteact

* Actual vote status

gen voteactstatus_whole = .

replace voteactstatus_whole = 3 if voteact == 1
replace voteactstatus_whole = 2 if voteact == 0
replace voteactstatus_whole = 1 if voteact!=1 & voteact!=. & voteactstatus_whole!=2

label values voteactstatus_whole votestatus

* Democratic candidate rating

gen demrating = ft_dpc

recode demrating -9=. -8=. -2=.

* Republican candidate rating

gen reprating = ft_rpc

recode reprating -9=. -8=. -2=.

* Candidate preference

gen preference = 2 if reprating > demrating
replace preference = 1 if demrating > reprating

* Candidate preference status

gen prefstatus_whole = .

replace prefstatus_whole = 0 if reprating > demrating
replace prefstatus_whole = . if demrating == reprating
replace prefstatus_whole = 1 if demrating > reprating

label define prefstatus 0 "Loser preference" 1 "Winner preference"
label values prefstatus_whole prefstatus

* John Boehner - Correct answer (Speaker of the House of Representatives) = 1, Incorrect answer = 0

gen boehner = ofcrec_speaker_imported

replace boehner = . if wave_completions!=1

* Joe Biden - Correct answer (U.S. vice-president) = 1, Incorrect answer = 0

gen biden = ofcrec_vp_imported

replace biden = . if wave_completions!=1

* David Cameron - Correct answer (British Prime Minister) = 1, Incorrect answer = 0

gen cameron = ofcrec_pmuk_imported

replace cameron = . if wave_completions!=1

* John Roberts - Correct answer (Supreme Court Chief Justice) = 1, Incorrect answer = 0

gen roberts = ofcrec_cj_imported

replace roberts = . if wave_completions!=1

* Party with the most members in the U.S. House before election - Correct answer (Republican) = 1, Incorrect answer = 0

gen house = knowl_housemaj

recode house -9=. -7=. -6=. -8=0 1=0 2=1

* Party with the most members in the U.S. Senate before election - Correct answer (Democrat) = 1, Incorrect answer = 0

gen senate = knowl_senmaj

recode senate -9=. -7=. -6=. -8=0 2=0

* Political knowledge index

gen knowledge = boehner + biden + cameron + roberts + house + senate

sum knowledge

gen knowledge_n = (knowledge - `r(min)') / (`r(max)'-`r(min)')

* Above average knowledge

egen knowledge_mean = mean(knowledge)
egen knowledge_sd = sd(knowledge)
gen knowledge_std = (knowledge - knowledge_mean)/knowledge_sd

gen knowledge_above = 0 if knowledge_std < 0
replace knowledge_above = 1 if knowledge_std > 0

* Economy (sociotropic)

gen econ_soc_now = econ_ecnow // Current

recode econ_soc_now -9=. -8=.

replace econ_soc_now = 6 - econ_soc_now

gen econ_soc_ret = econ_ecpast_x // Retrospective

recode econ_soc_ret -9=. -8=.

replace econ_soc_ret = 6 - econ_soc_ret

gen econ_soc_pro = econ_ecnext_x // Prospective

recode econ_soc_pro -9=. -8=.

replace econ_soc_pro = 6 - econ_soc_pro

* Economy (egotropic)

gen econ_ego_ret = finance_finpast_x // Retrospective

recode econ_ego_ret -9=. -8=.

replace econ_ego_ret = 6 - econ_ego_ret

gen econ_ego_pro = finance_finnext_x // Prospective

recode econ_ego_pro -9=. -8=.

replace econ_ego_pro = 6 - econ_ego_pro

* Economy index (sociotropic)
 
gen economy_soc = econ_soc_now + econ_soc_ret + econ_soc_pro

sum economy_soc

replace economy_soc = (economy_soc - `r(min)') / (`r(max)'-`r(min)')

* Economy index (egotropic)
 
gen economy_ego = econ_ego_ret + econ_ego_pro

sum economy_ego

replace economy_ego = (economy_ego - `r(min)') / (`r(max)'-`r(min)')

* Public officials don't care (pre)

gen dontcare_pre = effic_carestd

recode dontcare_pre -9=. -8=. -1=.

replace dontcare_pre = 5 - dontcare_pre

* Trust government to do right thing (pre)

gen govtright_pre = max(trustgov_trustgrev,trustgov_trustgstd)

recode govtright_pre -9=. -8=. -1=.

replace govtright_pre = govtright_pre - 1

* Waste money (pre)

gen waste_pre = trustgov_waste

recode waste_pre -9=. -8=.

replace waste_pre = 3 - waste_pre

* Big interests (pre)

gen biginterests_pre = trustgov_bigintrst

recode biginterests_pre -9=. -8=.

replace biginterests_pre = 2 - biginterests_pre

* Crooked (pre)

gen crooked_pre = trustgov_corrpt

recode crooked_pre -9=. -8=.

replace crooked_pre = 5 - crooked_pre

* Political cynicism (pre)

gen cynicism_pre = govtright_pre + waste_pre + biginterests_pre + crooked_pre

sum cynicism_pre

gen cynicism_pre_n = (cynicism_pre - `r(min)') / (`r(max)'-`r(min)')

* Public officials don't care (post)

gen dontcare_post = efficpo_carestd

recode dontcare_post -9=. -8=. -7=. -6=. -1=.

replace dontcare_post = 6 - dontcare_post

* Crooked (post)

gen crooked_post = trustgvpo_crook

recode crooked_post -9=. -8=.

replace crooked_post = 6 - crooked_post

* Difference who is in power (post)

gen diffpower_post = cses_diffpower

recode diffpower_post -9=. -8=. -7=. -6=.

replace diffpower_post = 6 - diffpower_post

* Political cynicism (post)

gen cynicism_post = dontcare_post + crooked_post + diffpower_post

sum cynicism_post

gen cynicism_post_n = (cynicism_post - `r(min)') / (`r(max)'-`r(min)')

* Political cynicism (pre and post)

gen crooked_prepost = crooked_pre
replace crooked_prepost = crooked_post if crooked_pre == .

gen cynicism_prepost = govtright_pre + waste_pre + biginterests_pre + crooked_prepost + dontcare_post + diffpower_post

sum cynicism_prepost

gen cynicism_prepost_n = (cynicism_prepost - `r(min)') / (`r(max)'-`r(min)')

* Above average political cynicism (pre)

egen cynicism_mean = mean(cynicism_pre)
egen cynicism_sd = sd(cynicism_pre)
gen cynicism_std = (cynicism_pre - cynicism_mean)/cynicism_sd

gen cynicism_above = 0 if cynicism_std < 0
replace cynicism_above = 1 if cynicism_std > 0

* Social mistrust

gen people = trust_social

recode people -9=. -8=.

sum people

* Was the President born in the U.S.?

gen born = nonmain_born

recode born -9=. -8=. -7=. -6=.

replace born = born - 1

* Does Health Care Act authorize end-of-life decision?

gen endlife = nonmain_endlife

recode endlife -9=. -8=. -7=. -6=.

replace endlife = 4 - endlife

* Did the U.S. government know about 9/11 in advance?

gen govt911 = nonmain_govt911

recode govt911 -9=. -8=. -7=. -6=.

replace govt911 = 4 - govt911

* Did the government direct Katrina flooding into poor areas?

gen hurricane = nonmain_hurric

recode hurricane -9=. -8=. -7=. -6=.

replace hurricane = 4 - hurricane

* Global warming

gen warming = envir_gwarm

recode warming -9=. -8=. 1=0 2=1

* Conspiratorial thinking

gen conspiracy = born + endlife + govt911 + hurricane

sum conspiracy

gen conspiracy_n = (conspiracy - `r(min)') / (`r(max)'-`r(min)')

egen conspiracy_n_std = std(conspiracy_n)

* Above average conspiratorial thinking

egen conspiracy_mean = mean(conspiracy)
egen conspiracy_sd = sd(conspiracy)
gen conspiracy_std = (conspiracy - conspiracy_mean)/conspiracy_sd

gen conspiracy_above = 0 if conspiracy_std < 0
replace conspiracy_above = 1 if conspiracy_std > 0

* Conspiratorial thinking (conservative)

gen conspiracy_cons = born + endlife

sum conspiracy_cons

replace conspiracy_cons = (conspiracy_cons - `r(min)') / (`r(max)'-`r(min)')

egen conspiracy_cons_std = std(conspiracy_cons)

* Conspiratorial thinking (liberal)

gen conspiracy_lib = govt911 + hurricane

sum conspiracy_lib

replace conspiracy_lib = (conspiracy_lib - `r(min)') / (`r(max)'-`r(min)')

egen conspiracy_lib_std = std(conspiracy_lib)

* Suspicion index

gen suspicion = govtright_pre + waste_pre + biginterests_pre + crooked_pre + born + endlife + govt911 + hurricane + people

recode suspicion 3=6 4=6 5=6 28=22 27=22 26=22 25=22 24=22 23=22

sum suspicion

replace suspicion = (suspicion - `r(min)') / (`r(max)'-`r(min)')

egen suspicion5 = xtile(suspicion), nq(5)

* Internal efficacy

gen efficacy = cses_diffvote

recode efficacy -9=. -8=. -7=. -6=.

* Survey weight

gen weight = weight_full


******************
** EXPECTATIONS **
******************

* Forecasts (1 = Democrat, 2 = Republican, 5 = other)

gen forecast_whole = preswin_win

recode forecast_whole -9=.

* Identify correct forecasts

gen correct_whole_d = 0 if forecast_whole!=1 & forecast_whole!=.
replace correct_whole_d = 1 if forecast_whole == 1

* Mean of correct forecasts by day

bysort time : egen correct_mean = mean(correct_whole_d)

* PID matches forecast

gen match = .

replace match = 1 if pid == 1 & forecast_whole == 1
replace match = 1 if pid == 2 & forecast_whole == 2
replace match = 0 if pid == 1 & forecast_whole == 2
replace match = 0 if pid == 2 & forecast_whole == 1

* Consistency (PID)

gen dissonant_p = .

replace dissonant_p = 0 if pid == 1 & forecast_whole == 1
replace dissonant_p = 1 if pid == 1 & forecast_whole == 2
replace dissonant_p = 1 if pid == 1 & forecast_whole == 5

replace dissonant_p = 0 if pid == 2 & forecast_whole == 2
replace dissonant_p = 1 if pid == 2 & forecast_whole == 1
replace dissonant_p = 1 if pid == 2 & forecast_whole == 5

* Consistency (vote)

gen dissonant_v = .

replace dissonant_v = 0 if voteact == 1 & forecast_whole == 1
replace dissonant_v = 1 if voteact == 1 & forecast_whole == 2
replace dissonant_v = 1 if voteact == 1 & forecast_whole == 7

replace dissonant_v = 0 if voteact == 2 & forecast_whole == 2
replace dissonant_v = 1 if voteact == 2 & forecast_whole == 1
replace dissonant_v = 1 if voteact == 2 & forecast_whole == 7


******************************
** RESPONDENTS' STATUS: PID **
******************************

* PID (all respondents)

gen unxloser_whole_p = 1 if pid == forecast_whole & pidstatus_whole == 1 & pid!=. // unexpected_p losers

gen exploser_whole_p = 1 if pid!=forecast_whole & pidstatus_whole == 1 & pid!=. // Expected losers

gen unxwinner_whole_p = 1 if pid!=forecast_whole & pidstatus_whole == 3 & pid!=. // unexpected_p winners

gen expwinner_whole_p = 1 if pid == forecast_whole & pidstatus_whole == 3 & pid!=. // Expected winners

gen nopid = 1 if pid == 0 // No PID

replace unxloser_whole_p = 0 if exploser_whole_p == 1 | unxwinner_whole_p == 1 | expwinner_whole_p == 1 | nopid == 1
replace exploser_whole_p = 0 if unxloser_whole_p == 1 | unxwinner_whole_p == 1 | expwinner_whole_p == 1 | nopid == 1
replace unxwinner_whole_p = 0 if unxloser_whole_p == 1 | exploser_whole_p == 1 | expwinner_whole_p == 1 | nopid == 1
replace expwinner_whole_p = 0 if unxloser_whole_p == 1 | exploser_whole_p == 1 | unxwinner_whole_p == 1 | nopid == 1
replace nopid = 0 if pid!=0 & pid!=.

gen status_whole_p = .

replace status_whole_p = 1 if unxloser_whole_p == 1
replace status_whole_p = 2 if exploser_whole_p == 1
replace status_whole_p = 3 if nopid == 1
replace status_whole_p = 4 if expwinner_whole_p == 1
replace status_whole_p = 5 if unxwinner_whole_p == 1
replace status_whole_p = . if pid == . | forecast_whole == .

* PID (excluding independents/others)

gen status_whole_p_noind = status_whole_p

replace status_whole_p_noind = . if pid == 0

* Generate binary variable for unexpected_p outcomes

gen unexpected_p = 0 if status_whole_p == 2 | status_whole_p == 4 | status_whole_p == 3 & correct_whole_d == 1
replace unexpected_p = 1 if status_whole_p == 1 | status_whole_p == 5 | status_whole_p == 3 & correct_whole_d == 0


*******************************
** RESPONDENTS' STATUS: VOTE **
*******************************

* Actual vote

gen unxloser_whole_v = 1 if voteact == forecast_whole & voteactstatus_whole == 1 & voteact!=. // unexpected_p losers

gen exploser_whole_v = 1 if voteact!=forecast_whole & voteactstatus_whole == 1 & voteact!=. // Expected losers

gen unxwinner_whole_v = 1 if voteact!=forecast_whole & voteactstatus_whole == 3 & voteact!=. // unexpected_p winners

gen expwinner_whole_v = 1 if voteact == forecast_whole & voteactstatus_whole == 3 & voteact!=. // Expected winners

gen novoteact = 1 if voteact == 0 // No vote

replace unxloser_whole_v = 0 if exploser_whole_v == 1 | unxwinner_whole_v == 1 | expwinner_whole_v == 1 | novoteact == 1
replace exploser_whole_v = 0 if unxloser_whole_v == 1 | unxwinner_whole_v == 1 | expwinner_whole_v == 1 | novoteact == 1
replace unxwinner_whole_v = 0 if unxloser_whole_v == 1 | exploser_whole_v == 1 | expwinner_whole_v == 1 | novoteact == 1
replace expwinner_whole_v = 0 if unxloser_whole_v == 1 | exploser_whole_v == 1 | unxwinner_whole_v == 1 | novoteact == 1
replace novoteact = 0 if voteact!=0 & voteact!=.

gen status_whole_v = .

replace status_whole_v = 1 if unxloser_whole_v == 1
replace status_whole_v = 2 if exploser_whole_v == 1
replace status_whole_v = 3 if novoteact == 1
replace status_whole_v = 4 if expwinner_whole_v == 1
replace status_whole_v = 5 if unxwinner_whole_v == 1
replace status_whole_v = . if voteact == . | forecast_whole == .

* Generate binary variable for unexpected_p outcomes

gen unexpected_v = 0 if status_whole_v == 2 | status_whole_v == 4 | status_whole_v == 3 & correct_whole_d == 1
replace unexpected_v = 1 if status_whole_v == 1 | status_whole_v == 5 | status_whole_v == 3 & correct_whole_d == 0


*************************************
** RESPONDENTS' STATUS: PREFERENCE **
*************************************

* Candidate preference

gen unxloser_whole_r = 1 if preference == forecast_whole & prefstatus_whole == 0 & preference!=. // Unexpected losers

gen exploser_whole_r = 1 if preference!=forecast_whole & prefstatus_whole == 0 & preference!=. // Expected losers

gen unxwinner_whole_r = 1 if preference!=forecast_whole & prefstatus_whole == 1 & preference!=. // Unexpected winners

gen expwinner_whole_r = 1 if preference == forecast_whole & prefstatus_whole == 1 & preference!=. // Expected winners

replace unxloser_whole_r = 0 if exploser_whole_r == 1 | unxwinner_whole_r == 1 | expwinner_whole_r == 1
replace exploser_whole_r = 0 if unxloser_whole_r == 1 | unxwinner_whole_r == 1 | expwinner_whole_r == 1
replace unxwinner_whole_r = 0 if unxloser_whole_r == 1 | exploser_whole_r == 1 | expwinner_whole_r == 1
replace expwinner_whole_r = 0 if unxloser_whole_r == 1 | exploser_whole_r == 1 | unxwinner_whole_r == 1

gen status_whole_r = .

replace status_whole_r = 1 if unxloser_whole_r == 1
replace status_whole_r = 2 if exploser_whole_r == 1
replace status_whole_r = 3 if expwinner_whole_r == 1
replace status_whole_r = 4 if unxwinner_whole_r == 1
replace status_whole_r = . if voteact == . | forecast_whole == .

* Generate binary variable for unexpected outcomes

gen unexpected_r = 0 if status_whole_r == 2 | status_whole_r == 3
replace unexpected_r = 1 if status_whole_r == 1 | status_whole_r == 4


**************************
** MERGE WITH POLL DATA **
**************************

* Merge

nearmrg using "us2012_polls.dta", lower nearvar(time)
drop _merge

* Congruent polling information

gen congruent = .

replace congruent = 1 if ahead_mean3 == 1 & forecast_whole == 1
replace congruent = 1 if ahead_mean3 == 2 & forecast_whole == 1 & pollmar_mean3 <= 2
replace congruent = 0 if ahead_mean3 == 2 & forecast_whole == 1 & pollmar_mean3 > 2

replace congruent = 1 if ahead_mean3 == 2 & forecast_whole == 2
replace congruent = 1 if ahead_mean3 == 1 & forecast_whole == 2 & pollmar_mean3 <= 2
replace congruent = 0 if ahead_mean3 == 1 & forecast_whole == 2 & pollmar_mean3 > 2


**********************
** SELECT VARIABLES **
**********************

* Keep needed variables

keep election podate integrity_4pts swd_post match pid pidstatus_whole pidscale_whole voteactstatus_whole prefstatus_whole unexpected_p unexpected_v unexpected_r conspiracy_above conspiracy_n_std cynicism_pre cynicism_pre_n cynicism_post cynicism_post_n cynicism_prepost cynicism_prepost_n cynicism_above conspiracy_n conspiracy_cons_std conspiracy_lib_std people suspicion suspicion5 economy_soc economy_ego knowledge_n knowledge_above male white age income income_above education postsecondary region closeness_whole care_whole correct_whole_d correct_mean time dissonant_p dissonant_v congruent pollmar_mean3 weight


**********
** SAVE **
**********

save "us2012_anes_integrity.dta", replace


************
** TABLES **
************

* Party identification

eststo: regress integrity_4pts i.pidstatus_whole conspiracy_n cynicism_pre_n people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.pidstatus_whole conspiracy_n cynicism_pre_n people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress integrity_4pts i.pidstatus_whole##i.unexpected_p conspiracy_n cynicism_pre_n people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.pidstatus_whole##i.unexpected_p conspiracy_n cynicism_pre_n people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]

esttab using "us2012_anes_integrity_pid.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white age income education 1.region 2.region 3.region 4.region 0.unexpected_p 1.pidstatus_whole#0.unexpected_p 2.pidstatus_whole#0.unexpected_p 3.pidstatus_whole#0.unexpected_p 1.pidstatus_whole#1.unexpected_p) refcat(1.pidstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_p "\textbf{\textit{Unexpected outcome?}}" 2.pidstatus_whole#1.unexpected_p "\textbf{\textit{2-way interaction}}" conspiracy_n "\textbf{\textit{Suspicious thinking}}" economy_ego "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("FAIR" "SWD" "FAIR" "SWD") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.pidstatus_whole "\hspace{1em} Loser (R)" 2.pidstatus_whole "\hspace{1em} Independent" 3.pidstatus_whole "\hspace{1em} Winner" 1.unexpected_p "\hspace{1em} Yes" 2.pidstatus_whole#1.unexpected_p "\hspace{1em} Independent $\times$ Unexpected" 3.pidstatus_whole#1.unexpected_p "\hspace{1em} Winner $\times$ Unexpected" cynicism_pre_n "\hspace{1em} Political cynicism" people "\hspace{1em} Social mistrust" conspiracy_n "\hspace{1em} Conspiracy beliefs" knowledge_n "\hspace{1em} Political knowledge" economy_ego "\hspace{1em} Egotropic" economy_soc "\hspace{1em} Sociotropic") order(1.pidstatus_whole 2.pidstatus_whole 3.pidstatus_whole 1.unexpected_p 2.pidstatus_whole#1.unexpected_p 3.pidstatus_whole#1.unexpected_p conspiracy_n cynicism_pre_n people economy_ego economy_soc knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2012 U.S. Presidential Election")

eststo clear

* Reported vote

eststo: regress integrity_4pts i.voteactstatus_whole conspiracy_n cynicism_pre_n people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.voteactstatus_whole conspiracy_n cynicism_pre_n people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress integrity_4pts i.voteactstatus_whole##i.unexpected_v conspiracy_n cynicism_pre_n people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.voteactstatus_whole##i.unexpected_v conspiracy_n cynicism_pre_n people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]

esttab using "us2012_anes_integrity_vote.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white age income education 1.region 2.region 3.region 4.region 0.unexpected_v 1.voteactstatus_whole#0.unexpected_v 2.voteactstatus_whole#0.unexpected_v 3.voteactstatus_whole#0.unexpected_v 1.voteactstatus_whole#1.unexpected_v) refcat(1.voteactstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_v "\textbf{\textit{Unexpected outcome?}}" 2.voteactstatus_whole#1.unexpected_v "\textbf{\textit{2-way interaction}}" conspiracy_n "\textbf{\textit{Suspicious thinking}}" economy_ego "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("FAIR" "SWD" "FAIR" "SWD") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.voteactstatus_whole "\hspace{1em} Loser (R)" 2.voteactstatus_whole "\hspace{1em} Non-voter" 3.voteactstatus_whole "\hspace{1em} Winner" 1.unexpected_v "\hspace{1em} Yes" 2.voteactstatus_whole#1.unexpected_v "\hspace{1em} Non-voter $\times$ Unexpected" 3.voteactstatus_whole#1.unexpected_v "\hspace{1em} Winner $\times$ Unexpected" cynicism_pre_n "\hspace{1em} Political cynicism" people "\hspace{1em} Social mistrust" conspiracy_n "\hspace{1em} Conspiracy beliefs" knowledge_n "\hspace{1em} Political knowledge" economy_ego "\hspace{1em} Egotropic" economy_soc "\hspace{1em} Sociotropic") order(1.voteactstatus_whole 2.voteactstatus_whole 3.voteactstatus_whole 1.unexpected_v 2.voteactstatus_whole#1.unexpected_v 3.voteactstatus_whole#1.unexpected_v conspiracy_n cynicism_pre_n people economy_ego economy_soc knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2012 U.S. Presidential Election")

eststo clear

* Conspiracy beliefs (conservative and liberal)

eststo: regress integrity_4pts i.pidstatus_whole##i.unexpected_p conspiracy_n_std cynicism_pre_n people knowledge_n i.male i.white age income education i.region
eststo: regress integrity_4pts i.pidstatus_whole##i.unexpected_p conspiracy_cons_std conspiracy_lib_std cynicism_pre_n people knowledge_n i.male i.white age income education i.region
eststo: regress swd_post i.pidstatus_whole##i.unexpected_p conspiracy_n_std cynicism_pre_n people economy_soc economy_ego knowledge_n i.male i.white age income education i.region
eststo: regress swd_post i.pidstatus_whole##i.unexpected_p conspiracy_cons_std conspiracy_lib_std cynicism_pre_n people economy_soc economy_ego knowledge_n i.male i.white age income education i.region

esttab using "us2012_anes_integrity_conspiracy_pid.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white 0.unexpected_p 1.pidstatus_whole#0.unexpected_p 2.pidstatus_whole#0.unexpected_p 3.pidstatus_whole#0.unexpected_p 1.pidstatus_whole#1.unexpected_p age income education 1.region 2.region 3.region 4.region) refcat(1.pidstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_p "\textbf{\textit{Unexpected outcome?}}" 2.pidstatus_whole#1.unexpected_p "\textbf{\textit{Interaction}}" conspiracy_n_std "\textbf{\textit{Suspicion}}" economy_soc "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("1 item" "2 items" "1 item" "2 items") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.pidstatus_whole "\hspace{1em} Loser (R)" 2.pidstatus_whole "\hspace{1em} Independent" 3.pidstatus_whole "\hspace{1em} Winner" 1.unexpected_p "\hspace{1em} Yes" 2.pidstatus_whole#1.unexpected_p "\hspace{1em} Independent $\times$ Unexpected" 3.pidstatus_whole#1.unexpected_p "\hspace{1em} Winner $\times$ Unexpected" conspiracy_n_std "\hspace{1em} Conspiracy beliefs" conspiracy_cons_std "\hspace{2em} Conspiracy beliefs (Con)" conspiracy_lib_std "\hspace{2em} Conspiracy beliefs (Lib)" cynicism_pre_n "\hspace{1em} Political cynicism" people "\hspace{1em} Social mistrust" economy_soc "\hspace{1em} Sociotropic" economy_ego "\hspace{1em} Egotropic" knowledge_n "\hspace{1em} Political knowledge") order(1.pidstatus_whole 2.pidstatus_whole 3.pidstatus_whole 1.unexpected_p 2.pidstatus_whole#1.unexpected_p 3.pidstatus_whole#1.unexpected_p conspiracy_n_std conspiracy_cons_std conspiracy_lib_std cynicism_pre_n people economy_soc economy_ego knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2012 U.S. Presidential Election")

eststo clear

eststo: regress integrity_4pts i.voteactstatus_whole##i.unexpected_v conspiracy_n_std cynicism_pre_n people knowledge_n i.male i.white age income education i.region
eststo: regress integrity_4pts i.voteactstatus_whole##i.unexpected_v conspiracy_cons_std conspiracy_lib_std cynicism_pre_n people knowledge_n i.male i.white age income education i.region
eststo: regress swd_post i.voteactstatus_whole##i.unexpected_v conspiracy_n_std cynicism_pre_n people economy_soc economy_ego knowledge_n i.male i.white age income education i.region
eststo: regress swd_post i.voteactstatus_whole##i.unexpected_v conspiracy_cons_std conspiracy_lib_std cynicism_pre_n people economy_soc economy_ego knowledge_n i.male i.white age income education i.region

esttab using "us2012_anes_integrity_conspiracy_vote.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white 0.unexpected_v 1.voteactstatus_whole#0.unexpected_v 2.voteactstatus_whole#0.unexpected_v 3.voteactstatus_whole#0.unexpected_v 1.voteactstatus_whole#1.unexpected_v age income education 1.region 2.region 3.region 4.region) refcat(1.voteactstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_v "\textbf{\textit{Unexpected outcome?}}" 2.voteactstatus_whole#1.unexpected_v "\textbf{\textit{Interaction}}" conspiracy_n_std "\textbf{\textit{Suspicion}}" economy_soc "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("1 item" "2 items" "1 item" "2 items") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.voteactstatus_whole "\hspace{1em} Loser (R)" 2.voteactstatus_whole "\hspace{1em} Non-voter" 3.voteactstatus_whole "\hspace{1em} Winner" 1.unexpected_v "\hspace{1em} Yes" 2.voteactstatus_whole#1.unexpected_v "\hspace{1em} Non-voter $\times$ Unexpected" 3.voteactstatus_whole#1.unexpected_v "\hspace{1em} Winner $\times$ Unexpected" conspiracy_n_std "\hspace{1em} Conspiracy beliefs" conspiracy_cons_std "\hspace{2em} Conspiracy beliefs (Con)" conspiracy_lib_std "\hspace{2em} Conspiracy beliefs (Lib)" cynicism_pre_n "\hspace{1em} Political cynicism" people "\hspace{1em} Social mistrust" economy_soc "\hspace{1em} Sociotropic" economy_ego "\hspace{1em} Egotropic" knowledge_n "\hspace{1em} Political knowledge") order(1.voteactstatus_whole 2.voteactstatus_whole 3.voteactstatus_whole 1.unexpected_v 2.voteactstatus_whole#1.unexpected_v 3.voteactstatus_whole#1.unexpected_v conspiracy_n_std conspiracy_cons_std conspiracy_lib_std cynicism_pre_n people economy_soc economy_ego knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2012 U.S. Presidential Election")

eststo clear

* Three-way interaction (PID)

eststo: regress integrity_4pts i.pidstatus_whole##i.unexpected_p##c.suspicion knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.pidstatus_whole##i.unexpected_p##c.suspicion economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]

esttab using "us2012_anes_integrity_3x_pid.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white age income education 1.region 2.region 3.region 4.region 0.unexpected_p 1.pidstatus_whole#0.unexpected_p 2.pidstatus_whole#0.unexpected_p 3.pidstatus_whole#0.unexpected_p 1.pidstatus_whole#1.unexpected_p 0.unexpected_p#c.suspicion 1.pidstatus_whole#c.suspicion 0.unexpected_p#c.suspicion 1.pidstatus_whole#1.unexpected_p#c.suspicion 1.pidstatus_whole#0.unexpected_p#c.suspicion 2.pidstatus_whole#0.unexpected_p#c.suspicion 3.pidstatus_whole#0.unexpected_p#c.suspicion) refcat(1.pidstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_p "\textbf{\textit{Unexpected outcome?}}" 2.pidstatus_whole#1.unexpected_p "\textbf{\textit{2-way interactions}}" 2.pidstatus_whole#1.unexpected_p#c.suspicion "\textbf{\textit{3-way interaction}}" suspicion "\textbf{\textit{Suspicious thinking}}" economy_ego "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("FAIR" "SWD") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.pidstatus_whole "\hspace{1em} Loser (R)" 2.pidstatus_whole "\hspace{1em} Independent" 3.pidstatus_whole "\hspace{1em} Winner" 1.unexpected_p "\hspace{1em} Yes" 2.pidstatus_whole#1.unexpected_p "\hspace{1em} Independent $\times$ Unexpected" 3.pidstatus_whole#1.unexpected_p "\hspace{1em} Winner $\times$ Unexpected" suspicion "\hspace{1em} Suspicion index" economy_ego "\hspace{1em} Egotropic" economy_soc "\hspace{1em} Sociotropic" knowledge_n "\hspace{1em} Political knowledge" 2.pidstatus_whole#c.suspicion "\hspace{1em} Independent $\times$ Suspicion" 3.pidstatus_whole#c.suspicion "\hspace{1em} Winner $\times$ Suspicion" 1.unexpected_p#c.suspicion "\hspace{1em} Unexpected $\times$ Suspicion" 2.pidstatus_whole#1.unexpected_p#c.suspicion "\hspace{1em} Independent $\times$ Unexpected $\times$ Suspicion" 3.pidstatus_whole#1.unexpected_p#c.suspicion "\hspace{1em} Winner $\times$ Unexpected $\times$ Suspicion") order(1.pidstatus_whole 2.pidstatus_whole 3.pidstatus_whole 1.unexpected_p 2.pidstatus_whole#1.unexpected_p 3.pidstatus_whole#1.unexpected_p 2.pidstatus_whole#c.suspicion 3.pidstatus_whole#c.suspicion 1.unexpected_p#c.suspicion 2.pidstatus_whole#1.unexpected_p#c.suspicion 3.pidstatus_whole#1.unexpected_p#c.suspicion suspicion economy_ego economy_soc knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2012 U.S. Presidential Election")

eststo clear

* Three-way interaction (vote)

eststo: regress integrity_4pts i.voteactstatus_whole##i.unexpected_v##c.suspicion knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.voteactstatus_whole##i.unexpected_v##c.suspicion economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]

esttab using "us2012_anes_integrity_3x_vote.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white age income education 1.region 2.region 3.region 4.region 0.unexpected_v 1.voteactstatus_whole#0.unexpected_v 2.voteactstatus_whole#0.unexpected_v 3.voteactstatus_whole#0.unexpected_v 1.voteactstatus_whole#1.unexpected_v 0.unexpected_v#c.suspicion 1.voteactstatus_whole#c.suspicion 0.unexpected_v#c.suspicion 1.voteactstatus_whole#1.unexpected_v#c.suspicion 1.voteactstatus_whole#0.unexpected_v#c.suspicion 2.voteactstatus_whole#0.unexpected_v#c.suspicion 3.voteactstatus_whole#0.unexpected_v#c.suspicion) refcat(1.voteactstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_v "\textbf{\textit{Unexpected outcome?}}" 2.voteactstatus_whole#1.unexpected_v "\textbf{\textit{2-way interactions}}" 2.voteactstatus_whole#1.unexpected_v#c.suspicion "\textbf{\textit{3-way interaction}}" suspicion "\textbf{\textit{Suspicious thinking}}" economy_ego "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("FAIR" "SWD") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.voteactstatus_whole "\hspace{1em} Loser (R)" 2.voteactstatus_whole "\hspace{1em} Non-voter" 3.voteactstatus_whole "\hspace{1em} Winner" 1.unexpected_v "\hspace{1em} Yes" 2.voteactstatus_whole#1.unexpected_v "\hspace{1em} Non-voter $\times$ Unexpected" 3.voteactstatus_whole#1.unexpected_v "\hspace{1em} Winner $\times$ Unexpected" suspicion "\hspace{1em} Suspicion index" economy_ego "\hspace{1em} Egotropic" economy_soc "\hspace{1em} Sociotropic" knowledge_n "\hspace{1em} Political knowledge" 2.voteactstatus_whole#c.suspicion "\hspace{1em} Independent $\times$ Suspicion" 3.voteactstatus_whole#c.suspicion "\hspace{1em} Winner $\times$ Suspicion" 1.unexpected_v#c.suspicion "\hspace{1em} Unexpected $\times$ Suspicion" 2.voteactstatus_whole#1.unexpected_v#c.suspicion "\hspace{1em} Independent $\times$ Unexpected $\times$ Suspicion" 3.voteactstatus_whole#1.unexpected_v#c.suspicion "\hspace{1em} Winner $\times$ Unexpected $\times$ Suspicion") order(1.voteactstatus_whole 2.voteactstatus_whole 3.voteactstatus_whole 1.unexpected_v 2.voteactstatus_whole#1.unexpected_v 3.voteactstatus_whole#1.unexpected_v 2.voteactstatus_whole#c.suspicion 3.voteactstatus_whole#c.suspicion 1.unexpected_v#c.suspicion 2.voteactstatus_whole#1.unexpected_v#c.suspicion 3.voteactstatus_whole#1.unexpected_v#c.suspicion suspicion economy_ego economy_soc knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2012 U.S. Presidential Election")

eststo clear

* Party identification, Political cynicism

eststo: regress integrity_4pts i.pidstatus_whole##i.unexpected_p conspiracy_n cynicism_pre_n people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress integrity_4pts i.pidstatus_whole##i.unexpected_p conspiracy_n cynicism_post_n people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress integrity_4pts i.pidstatus_whole##i.unexpected_p conspiracy_n cynicism_prepost_n people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.pidstatus_whole##i.unexpected_p conspiracy_n cynicism_pre_n people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.pidstatus_whole##i.unexpected_p conspiracy_n cynicism_post_n people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.pidstatus_whole##i.unexpected_p conspiracy_n cynicism_prepost_n people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]

esttab using "us2012_anes_integrity_cynicism_pid.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white age income education 1.region 2.region 3.region 4.region 0.unexpected_p 1.pidstatus_whole#0.unexpected_p 2.pidstatus_whole#0.unexpected_p 3.pidstatus_whole#0.unexpected_p 1.pidstatus_whole#1.unexpected_p) refcat(1.pidstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_p "\textbf{\textit{Unexpected outcome?}}" 2.pidstatus_whole#1.unexpected_p "\textbf{\textit{2-way interaction}}" conspiracy_n "\textbf{\textit{Suspicious thinking}}" economy_ego "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("FAIR" "SWD" "FAIR" "SWD") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.pidstatus_whole "\hspace{1em} Loser (R)" 2.pidstatus_whole "\hspace{1em} Independent" 3.pidstatus_whole "\hspace{1em} Winner" 1.unexpected_p "\hspace{1em} Yes" 2.pidstatus_whole#1.unexpected_p "\hspace{1em} Independent $\times$ Unexpected" 3.pidstatus_whole#1.unexpected_p "\hspace{1em} Winner $\times$ Unexpected" cynicism_pre_n "\hspace{1em} Political cynicism (pre)" cynicism_post_n "\hspace{1em} Political cynicism (post)" cynicism_prepost_n "\hspace{1em} Political cynicism (pre/post)" people "\hspace{1em} Social mistrust" conspiracy_n "\hspace{1em} Conspiracy beliefs" knowledge_n "\hspace{1em} Political knowledge" economy_ego "\hspace{1em} Egotropic" economy_soc "\hspace{1em} Sociotropic") order(1.pidstatus_whole 2.pidstatus_whole 3.pidstatus_whole 1.unexpected_p 2.pidstatus_whole#1.unexpected_p 3.pidstatus_whole#1.unexpected_p conspiracy_n cynicism_pre_n cynicism_post_n cynicism_prepost_n people economy_ego economy_soc knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2012 U.S. Presidential Election")

eststo clear

* Reported vote, Political cynicism

eststo: regress integrity_4pts i.voteactstatus_whole##i.unexpected_v conspiracy_n cynicism_pre_n people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress integrity_4pts i.voteactstatus_whole##i.unexpected_v conspiracy_n cynicism_post_n people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress integrity_4pts i.voteactstatus_whole##i.unexpected_v conspiracy_n cynicism_prepost_n people knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.voteactstatus_whole##i.unexpected_v conspiracy_n cynicism_pre_n people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.voteactstatus_whole##i.unexpected_v conspiracy_n cynicism_post_n people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]
eststo: regress swd_post i.voteactstatus_whole##i.unexpected_v conspiracy_n cynicism_prepost_n people economy_ego economy_soc knowledge_n i.male i.white age income education i.region [pweight=weight]

esttab using "us2012_anes_integrity_cynicism_vote.tex", alignment(ll) substitute({table} {table*} \begin{tabular*} \small\begin{tabular*}) wide drop(0.male 1.male 0.white 1.white age income education 1.region 2.region 3.region 4.region 0.unexpected_v 1.voteactstatus_whole#0.unexpected_v 2.voteactstatus_whole#0.unexpected_v 3.voteactstatus_whole#0.unexpected_v 1.voteactstatus_whole#1.unexpected_v) refcat(1.voteactstatus_whole "\textbf{\textit{Electoral status}}" 1.unexpected_v "\textbf{\textit{Unexpected outcome?}}" 2.voteactstatus_whole#1.unexpected_v "\textbf{\textit{2-way interaction}}" conspiracy_n "\textbf{\textit{Suspicious thinking}}" economy_ego "\textbf{\textit{Economic evaluations}}" knowledge_n "\textbf{\textit{Information}}", nolabel) width(\hsize) pr2(2) b(2) not star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label mtitles("FAIR" "SWD" "FAIR" "SWD") interaction("$\times$")style(tex) replace booktabs varlabels(_cons "\textbf{\textit{Constant}}" 1.voteactstatus_whole "\hspace{1em} Loser (R)" 2.voteactstatus_whole "\hspace{1em} Non-voter" 3.voteactstatus_whole "\hspace{1em} Winner" 1.unexpected_v "\hspace{1em} Yes" 2.voteactstatus_whole#1.unexpected_v "\hspace{1em} Non-voter $\times$ Unexpected" 3.voteactstatus_whole#1.unexpected_v "\hspace{1em} Winner $\times$ Unexpected" cynicism_pre_n "\hspace{1em} Political cynicism (pre)" cynicism_post_n "\hspace{1em} Political cynicism (post)" cynicism_prepost_n "\hspace{1em} Political cynicism (pre/post)" people "\hspace{1em} Social mistrust" conspiracy_n "\hspace{1em} Conspiracy beliefs" knowledge_n "\hspace{1em} Political knowledge" economy_ego "\hspace{1em} Egotropic" economy_soc "\hspace{1em} Sociotropic") order(1.voteactstatus_whole 2.voteactstatus_whole 3.voteactstatus_whole 1.unexpected_v 2.voteactstatus_whole#1.unexpected_v 3.voteactstatus_whole#1.unexpected_v conspiracy_n cynicism_pre_n cynicism_post_n cynicism_prepost_n people economy_ego economy_soc knowledge_n) stats(N r2, labels("Observations" "\textit{R}\textsuperscript{2}") fmt(%9.0fc %9.2fc)) nonotes title("Perceived Electoral Integrity and Satisfaction with Democracy, 2012 U.S. Presidential Election")

eststo clear

log close